/**
 * 该模块主要负责创建学生模型
 */
let mongoose = require("mongoose")
let Schema = mongoose.Schema

let studentSchema = new Schema({
    stu_id: {
        type: String,
        require: true,
        unique: true
    },
    name: {
        type: String,
        require: true,
    },
    age: {
        type: Number,
        require: true,
    },
    sex: {
        type: String,
        require: true
    },
    hobby: [String],
    info: {
        type: Schema.Types.Mixed
    },
    date: {
        type: Date,
        default: Date.now()
    },
    enable_flag: {
        type: String,
        default: "Y"
    }
})

module.exports = mongoose.model("students", studentSchema)